home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / QuickDraw GX / QuickDraw GX Info / QuickDraw GX Interfaces / Interfaces & Libraries / interfaces / font library.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-30  |  2.8 KB  |  95 lines  |  [TEXT/MPS ]

  1. /* graphics libraries:  
  2.  font library interfaces
  3.   by Cary Clark, Georgiann Delaney, Michael Fairman, Dave Good, Robert Johnson, Keith McGreggor, Mike Reed, Oliver Steele, David Van Brink, Chris Yerga
  4.   Copyright 1987 - 1993 Apple Computer, Inc.  All rights reserved.
  5. */
  6.  
  7. #pragma once
  8. #ifndef fontLibraryIncludes
  9.     #define fontLibraryIncludes
  10.     
  11.     #ifndef fontTypesIncludes
  12.         #include "font types.h"
  13.     #endif
  14.     
  15.     #ifndef graphicsTypesIncludes
  16.          #include "graphics types.h"
  17.     #endif
  18.     
  19.     #ifndef fontRoutinesIncludes
  20.         #include "font routines.h"
  21.     #endif
  22.     
  23.     #ifdef __cplusplus
  24.     extern "C" {
  25.     #endif
  26.     
  27.     /*  example gxFont descriptor tags
  28.     */
  29.     #define weightVariationTag        0x77676874    /* 'wght' */
  30.     #define widthVariationTag            0x77647468    /* 'wdth' */
  31.     #define slantVariationTag            0x736c6e74    /* 'slnt' */
  32.     #define opticalScaleVariationTag    0x6f70737a    /* 'opsz' */
  33.     
  34.     /* weights for gxStyle matching */
  35.     /* these will have to be tweaked*/
  36.     /* this info could be in the gxFont???*/
  37.     #define prefwghtweighting    0x00010000
  38.     #define prefwdthweighting    0x00020000
  39.     #define prefslntweighting        0x00010000    /*this is naturally weighted to last place*/
  40.     #define prefcontweighting        0x00040000
  41.     
  42.     enum commonFonts {
  43.         firstCommonFont,
  44.          chicagoFont = firstCommonFont,
  45.         courierFont,
  46.          genevaFont,
  47.         helveticaFont,
  48.          monacoFont,
  49.          newyorkFont,
  50.         symbolFont,
  51.          timesFont,
  52.          lastCommonFont = timesFont
  53.     };
  54.     
  55.     typedef long commonFont;
  56.  
  57.     enum matchingStyles {
  58.         noMatching = 0,
  59.         useStyleMatching,
  60.         useVariationsMatching,
  61.          useTextFaceMatching= 4
  62.     };
  63.     
  64.     typedef long matchingStyle;
  65.  
  66.     gxFont GetCommonFont(commonFont font);
  67.     void SetShapeCommonFont(gxShape target, commonFont font);
  68.     void SetStyleCommonFont(gxStyle target, commonFont font);
  69.     
  70.     gxFont FindCNameFont(gxFontName meaning, const char name[]);
  71.     gxFont FindPNameFont(gxFontName meaning, const unsigned char name[]);
  72.     
  73.     long FindFontCName(gxFont fontID, gxFontName meaning, char name[]);
  74.     long FindFontPName(gxFont fontID, gxFontName meaning, unsigned char name[]);
  75.     
  76.     long FindStyleFontCName(gxStyle source, gxFontName meaning, char name[]);
  77.     long FindStyleFontPName(gxStyle source, gxFontName meaning, unsigned char name[]);
  78.     void SetStylePNamedFont(gxStyle target, const unsigned char name[]);
  79.     void SetStyleCNamedFont(gxStyle target, const char* name);
  80.     
  81.     long CountFontFamilies(void);
  82.     gxFont FindFontFamily(long index, gxFontPlatform platform, gxFontScript script, gxFontLanguage language,
  83.       long nameLength, const unsigned char *name);
  84.     long CountFontStyles(gxFont family);
  85.     gxFont FindFontStyle(gxFont family, long index, gxFontPlatform platform, gxFontScript script, gxFontLanguage language,
  86.       long nameLength, const unsigned char *name);
  87.     
  88.     void SetMatchingStyle(gxFont targetFamily, gxStyle theStyle, matchingStyle matchInfo);
  89.     gxStyle ReturnMatchingStyle(gxFont targetFamily, gxStyle theStyle, matchingStyle matchInfo);
  90.     
  91.     #ifdef __cplusplus
  92.     }
  93.     #endif
  94. #endif
  95.